package registnet.records;

import java.util.List;
import java.util.Vector;

public class Checklist {

	private Student student;
	private List<ICourse> courses = new Vector<ICourse>();
	private List<ICourse> recommendedCourses = new Vector<ICourse>();;
	private List<ICourse> extraCourses = new Vector<ICourse>();;

	
	/**
	 * Default constructor
	 * 
	 * @param student
	 */
	public Checklist(Student student){
		this.student = student;
	}
	
	
	/**
	 * Gets the student who owns the checklist
	 * 
	 * @return	The student who owns the checklist
	 */
	public Student getStudent(){
		return this.student;
	}
	
	
	/**
	 * Sets the student who owns the checklist
	 * 
	 * @param student - The student who owns the checklist
	 */
	public void setStudent(Student student){
		this.student = student;
	}
	
	
	/**
	 * Gets the courses included in the checklist
	 * 
	 * @return	The courses included in the checklist
	 */
	public List<ICourse> getCourses(){
		return this.courses;
	}
	
	
	/**
	 * Adds the course into the checklist
	 * 
	 * @param course - The course to add
	 */
	public void addCourse(ICourse course){
		this.courses.add(course);
	}
	
	
	/**
	 * Gets the recommended courses
	 * 
	 * @return The recommended courses
	 */
	public List<ICourse> getRecommendedCourses(){
		return this.recommendedCourses;
	}
	
	
	/**
	 * Adds the course into the recommended courses
	 * 
	 * @param course - The course to add
	 */
	public void addRecommendedCourse(ICourse course){
		this.recommendedCourses.add(course);
	}
	
	
	/**
	 * Gets the extra courses
	 * 
	 * @return	The extra courses
	 */
	public List<ICourse> getExtraCourses(){
		return this.extraCourses;
	}
	
	
	/**
	 * Adds the course into the extra courses
	 * 
	 * @param course - The course to add
	 */
	public void addExtraCourse(ICourse course){
		this.extraCourses.add(course);
	}
	
	
	public List<ICourse> getCourses(int semester, int year){
		List<ICourse> courses = new Vector<ICourse>();
		for(int i=0; i<this.courses.size(); i++){
			ICourse cc = this.courses.get(i);
			if (cc.getSemester() == semester && cc.getYear() == year)
				courses.add(cc);
		}
		return courses;
	}
	
}
